package com.rich.component.transaction;

import java.lang.reflect.Method;

import org.springframework.aop.AfterReturningAdvice;
import org.springframework.aop.MethodBeforeAdvice;

public class HistoryOperateAcvice implements AfterReturningAdvice,
		MethodBeforeAdvice {

	public void afterReturning(Object arg0, Method method, Object[] arg2,
			Object target) throws Throwable {
		// System.out.println(method.getDeclaringClass()+"\n"+arg2[0]);
		// System.out.println(target);
		// TODO 在实现方法后，记得删除todo注释
		System.out.println("@@进入 AfterReturningAdvice");

		// if (true)
		// throw new RuntimeException("拦截异常！");
		System.out.println("@@退出 AfterReturningAdvice");
	}

	public void before(Method arg0, Object[] arg1, Object arg2)
			throws Throwable {
		// TODO 在实现方法后，记得删除todo注释
		System.out.println("@@进入 MethodBeforeAdvice");
		System.out.println("@@退出 MethodBeforeAdvice");
	}

}
